<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    
</head>
<body>
    <button onclick='document.getElementById("demo").innerHTML=Date()'>现在的时间是？</button>
    <p id="demo"></p>
    <button onclick="sz()">dianij</button>
</body>
<script>

        function sz(){
            var array = [4,5,6,7,5,6,3,2,7];
            var demo = document.getElementById("demo");
            var m = 100;
            for(let i=0,n=m;i<n;i++){
                setTimeout(()=>{
                    demo.innerHTML= m--;
                    f(m);
                },i*200);
            }
        }
        var f = (a)=>{
            console.log(a);
        }
        
</script>
</html>